package com.atguigu.spzx.product.controller;

import com.atguigu.spzx.model.entity.product.Brand;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.product.service.BrandService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/product")
@Tag(name = "品牌模块")
public class BrandController {
    @Resource
    BrandService brandService;
    @GetMapping("/brand/findAll")
    public Result findAll(){
        //如果业务层需要使用缓存管理，可以自定义业务方法然后加注解
        List<Brand> brands = brandService.list();
        return Result.ok().data(brands);
    }
}
